<script>
	import timeout from './servers/timeout.js';
	export default {
		data() {
			return {
				show:true
			}
		},
		onLaunch: function() {
		    console.log('App Launch');
		    // #ifdef APP-PLUS
		    // 锁定屏幕方向
		    plus.screen.lockOrientation('portrait-primary'); //锁定
		    // 检测升级
		    uni.request({
		        url: 'https://uniapp.dcloud.io/update', //检查更新的服务器地址
		        data: {
		            appid: plus.runtime.appid,
		            version: plus.runtime.version,
		            imei: plus.device.imei
		        },
		        success: (res) => {
		            if (res.statusCode == 200 && res.data.isUpdate) {
		                let openUrl = plus.os.name === 'iOS' ? res.data.iOS : res.data.Android;
		                // 提醒用户更新
		                uni.showModal({
		                    title: '更新提示',
		                    content: res.data.note ? res.data.note : '是否选择更新',
		                    success: (showResult) => {
		                        if (showResult.confirm) {
		                            plus.runtime.openURL(openUrl);
		                        }
		                    }
		                })
		            }
		        }
		    })
		    // #endif
		},
		onShow: function() {
			this.show = true
			this.setTime()
		},
		onHide: function() {
			this.show = false
			console.log('App Hide')
		},
		methods:{
			setTime(){
				var _this =this
				if(_this.show){
					timeout.timeout()
					
				}
				setTimeout(function(){
					_this.setTime()
				},60000)
			}
		}
	}
</script>
<style lang="less">
	* {
		margin: 0;
		padding: 0;
		/* font-family: "微软雅黑"; */
		-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
	}
	.left {
		float: left;
	}
	
	.right {
		float: right;
	}
	
	.ceng {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.3);
		z-index: 99;
	}
	
	.go-top {
		position: fixed;
		bottom: 198rpx;
		right: 20rpx;
		width: 90rpx;
		height: 90rpx;
		border-radius: 50%;
		background: #fef5fb;
		box-shadow: 1rpx 0rpx 10rpx #efa4d3;
		/*no*/
		text-align: center;
		z-index: 9;
	
	}
	
	.go-top image {
		width: 46rpx;
		height: 46rpx;
		margin: 18rpx 0;
	}
	
	.uni-page-head {
		border-bottom: 1px solid #e1e1e1;
	}
	
	.uni-navbar--fixed {
		width: 100%;
		border-bottom-color: #e1e1e1 !important;
	}
	
	.headline {
		position: relative;
		font-size: 16px;
		font-weight: 700;
		height: 44px;
		line-height: 30px;
		padding: 7px 3px;
		color: #000;
		text-align: center;
		z-index: 998;
		background: #fff;
		border-bottom: 1px solid #e1e1e1;
		box-sizing: border-box;
		/* box-sizing: border-box; */
		/*no*/
	}
	
	.headline .uni-btn-icon {
		position: absolute;
		top: 20rpx;
		left: 20rpx;
		display: block;
		width: 43rpx;
		height: 43rpx;
		line-height: 43rpx;
		text-align: center;
		font-size: 50rpx;
		font-weight: 100;
	}
	
	.uni-drawer__content {
		min-width: 580rpx;
		max-width: 580rpx;
		overflow: auto;
		padding: 20rpx;
		box-sizing: border-box;
	}
	
	.cut-off {
		/*分隔块*/
		height: 26rpx;
		background: #f6f6f6;
	}
	img{
		width: 100%;
	}
	.status_bar {
		// #ifndef H5
		height: var(--status-bar-height);
		width: 100%;
		background: #fff;
		// #endif
	}
	.pagination {
		max-width: 710rpx;
		margin: 50rpx auto;
		text-align: center;
		line-height: 80rpx;
		font-size: 28rpx;
		.center {
			width: 176rpx;
			height: 80rpx;
			display: inline-block;
			margin: 0 30rpx;
			color: #666666;
			background: #ffffff;
			border-radius: 6rpx;
			border: 1px solid #d0d0d0;
			box-sizing: border-box;
		}
		.left,
		.right {
			width: 220rpx;
			height: 80rpx;
			background: #bd3c8c;
			color: #fff;
			border-radius: 6rpx;
			box-sizing: border-box;
		}
		.forbid {
			background: #ffffff;
			border: 1px solid #d0d0d0;
			color: #aaaaaa;
			.icons {
				color: #aaaaaa !important;
			}
		}
	}
	.none {
		text-align: center;
		line-height: 80vh;
		color: #848484;
	}
	.notavailable{
		text-align: center;
		padding-top: 10vh;
		image{
			width: 300rpx;
		}
		.nottext{
			color: #a0a0a0;
		}
	}
</style>
